import { ES3DTileset, ESImageryLayer, ESSceneObject, ESTerrainLayer } from "earthsdk3";
import { getCzmCodeFromESTerrainLayer } from "./getCzmCodeFromESTerrainLayer";
import { getCzmCodeFromESImageryLayer } from "./getCzmCodeFromESImageryLayer";
import { getCzmCodeFromES3DTileset } from "./getCzmCodeFromES3DTileset";

export function getCzmCode(sceneObject: ESSceneObject) {
    if (sceneObject instanceof ESImageryLayer) {
        return getCzmCodeFromESImageryLayer(sceneObject);
    }
    if (sceneObject instanceof ESTerrainLayer) {
        return getCzmCodeFromESTerrainLayer(sceneObject);
    }
    if (sceneObject instanceof ES3DTileset) {
        return getCzmCodeFromES3DTileset(sceneObject);
    }
    return "getCzmCode目前只支持影像地形或瓦片"
}